<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cyt.${moduleName?replace('/', '.')}.dao.${entityName}Dao">

    <select id="findVoOne" parameterType="com.cyt.${moduleName?replace('/', '.')}.domain.dto.${entityName}Dto" resultType="com.cyt.${moduleName?replace('/', '.')}.domain.vo.${entityName}Vo">
        select t.*
        from ${table.sqlName} t
        where t.remove_tag = '0'
        <if test="id != null and id != ''">
            and t.id = ${r'#{id}'}
        </if>
    </select>

    <select id="findVoList" parameterType="com.cyt.${moduleName?replace('/', '.')}.domain.dto.${entityName}Dto" resultType="com.cyt.${moduleName?replace('/', '.')}.domain.vo.${entityName}Vo">
        select t.*
        from ${table.sqlName} t
        where t.remove_tag = '0'
        <if test="id != null and id != ''">
            and t.id in
            <foreach item="id" collection="id.split(',')" open="(" separator="," close=")">
                ${r'#{id}'}
            </foreach>
        </if>
    </select>

    <select id="findForExcel" parameterType="com.cyt.${moduleName?replace('/', '.')}.domain.dto.${entityName}Dto" resultType="com.cyt.${moduleName?replace('/', '.')}.domain.vo.excel.${entityName}ExportVo">
        select
<#list table.columns as column>
    <#if column.columnName != "Id" && column.columnName!="RemoveTag" && column.columnName!="Creator" && column.columnName!="CreateTime" && column.columnName!="Updater" && column.columnName!="UpdateTime">
        <#if column_index == (table.columns?size-6)>
            t.${column.sqlName}
        <#else>
            t.${column.sqlName},
        </#if>
    </#if>
</#list>
        from ${table.sqlName} t
        where t.remove_tag = '0'
        <if test="id != null and id != ''">
            and t.id in
            <foreach item="id" collection="id.split(',')" open="(" separator="," close=")">
                ${r'#{id}'}
            </foreach>
        </if>
        LIMIT ${r'#{pageNum}'}, ${r'#{pageSize}'}
    </select>
</mapper>
